package com.li.youhappygo.model.vo.common;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

@Getter
@Schema(description = "响应状态")
public enum ResultCode {
    @Schema(description = "操作成功")
    SUCCESS(200 , "操作成功") ,
    @Schema(description = "操作失败")
    FAIL(201 , "操作失败") ,
    @Schema(description = "用户名或者密码错误")
    LOGIN_ERROR(201 , "用户名或者密码错误"),

    @Schema(description = "用户未登录")
    LOGIN_AUTH(208 , "用户未登录"),

    @Schema(description = "系统异常")
    SYSTEM_ERROR(9999 , "您的网络有问题请稍后重试"),
    @Schema(description = "数据异常")
    DATA_ERROR(204, "数据异常"),

    STOCK_LESS( 219, "库存不足"),

    ;

    private Integer code ;      // 业务状态码
    private String message ;    // 响应消息

    private ResultCode(Integer code , String message) {
        this.code = code ;
        this.message = message ;
    }

//    @Override
//    public String toString() {
//        return this.name()+":"+this.code+":"+this.message;
//    }
}
